/* eslint-disable react/jsx-no-bind */
import {Button, Result} from 'antd';
import React from 'react';
import {history} from 'umi';

export interface ErrorComProps {
    error: Error
}

const ErrorCom: React.FC<ErrorComProps> = ({error}) => (
    <Result
        status="error"
        title={error?.name}
        subTitle={error?.message}
        extra={(
            <Button onClick={() => history.push('/')}>返回首页</Button>
        )}
    />
);

export default ErrorCom;
